package com.ruoyi.pmdata.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.pmdata.domain.EasPmdata;
import com.ruoyi.pmdata.service.IEasPmdataService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 设备PMController
 * 
 * @author ruoyi
 * @date 2025-04-03
 */
@RestController
@RequestMapping("/pmdata/pmdata")
public class EasPmdataController extends BaseController
{
    @Autowired
    private IEasPmdataService easPmdataService;

    /**
     * 查询设备PM列表
     */
    @PreAuthorize("@ss.hasPermi('pmdata:pmdata:list')")
    @GetMapping("/list")
    public TableDataInfo list(EasPmdata easPmdata)
    {
        startPage();
        List<EasPmdata> list = easPmdataService.selectEasPmdataList(easPmdata);
        return getDataTable(list);
    }

    /**
     * 导出设备PM列表
     *//*
    @PreAuthorize("@ss.hasPermi('pmdata:pmdata:export')")
    @Log(title = "设备PM", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EasPmdata easPmdata)
    {
        List<EasPmdata> list = easPmdataService.selectEasPmdataList(easPmdata);
        ExcelUtil<EasPmdata> util = new ExcelUtil<EasPmdata>(EasPmdata.class);
        util.exportExcel(response, list, "设备PM数据");
    }*/

    /**
     * 获取设备PM详细信息
     */
    @PreAuthorize("@ss.hasPermi('pmdata:pmdata:query')")
    @GetMapping(value = "/{ID}")
    public AjaxResult getInfo(@PathVariable("ID") String ID)
    {
        return success(easPmdataService.selectEasPmdataByID(ID));
    }


}
